package com.example.mongodb.base;

import java.io.Serializable;

import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.repository.query.MongoEntityInformation;
import org.springframework.data.mongodb.repository.support.SimpleMongoRepository;

public class BaseMongoDbRepositoryImpl<T, ID extends Serializable> extends SimpleMongoRepository<T,ID> implements BaseMongoDbRepository<T, ID> {

	protected final MongoOperations mongoTemplate; 
	protected final MongoEntityInformation<T, ID> entityInformation; 
	private Class<T> clazz;
	
	public BaseMongoDbRepositoryImpl(MongoEntityInformation<T, ID> metadata, MongoOperations mongoOperations) {
		super(metadata, mongoOperations); 
		this.mongoTemplate = mongoOperations;
		this.entityInformation = metadata; 
		clazz = entityInformation.getJavaType();
	}
}
